/**
 * IAdvisable.java
 * 
 * Created on Jul 10, 2008 at 12:40:21 AM
 */
package org.lego4j.internal;

import org.lego4j.IValidableAdvisor;
import org.springframework.beans.factory.support.BeanDefinitionValidationException;

/**
 * TODO add javadoc to IAdvisable
 *
 * @author <a href="alexguev@gmail.com">Alexei Guevara</>
 * @version $Revision:$ updated on $Date:$ by $Author:$
 */
public interface IAdvisable {

    /**
     * @param theAdvisor The advisor.
     * @return <b>true</b> if the advisor can be applied to instances of this {@link IAdvisable}.
     */
    boolean canApply(IValidableAdvisor theAdvisor);
    
    /**
     * @param theAdvisor The advisor to apply to this advisable.
     * 
     * @throws BeanDefinitionValidationException If the advisor can not be applied to the bean. 
     */
    void addAdvisor(IValidableAdvisor theAdvisor) throws BeanDefinitionValidationException;

    /**
     * @return The adviced/proxied bean.
     */
    Object getAdvicedBean();    
}
